package com.coldwindblows.blog.utils.backup.db;

import java.util.ArrayList;

public class ColumnCollection extends ArrayList<Column> {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public int indexByLabel(String label) {
		for(int i = 0; i < this.size(); i++) {
			if(get(i).getLabel().equals(label)) {
				return i;
			}
		}
		return -1;
	}

	@Override
	public String toString() {
		if(size() == 0) {
			return "Columns is empty";
		}
		String s = "Column : {" + String.valueOf(get(0).getLabel());
		for(int i = 1; i < size(); i++) {
			s += "," + String.valueOf(get(i).getLabel());
		}
		s += "}";
		return s;
	}
	
}
